#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long LL;
typedef double db;
inline int read()
{
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9') { if(ch=='-')f=-1; ch=getchar(); }
	while(ch>='0'&&ch<='9') { x=(x<<1)+(x<<3)+ch-'0'; ch=getchar(); }
	return x*f;
}
const int MAXN=260;
int n,m,K,mp[MAXN][MAXN],head[MAXN],cnt,match[MAXN],tot,a[MAXN*MAXN];
bool vis[MAXN];
struct edge
{
	int v,next;
}e[MAXN*MAXN];
void addedge(int x,int y)
{
	e[++cnt]=(edge){y,head[x]};
	head[x]=cnt;
	return;
}
bool Hungary(int u)
{
	for(int i=head[u];i;i=e[i].next)
	{
		int v=e[i].v;
		if(!vis[v])
		{
			vis[v]=true;
			if(!match[v]||Hungary(match[v]))
			{
				match[v]=u;
				return true;
			}
		}
	}
	return false;
}
bool chk(int x)
{
	memset(head,0,sizeof(head));cnt=0;
	for(int i=1;i<=n;++i)
		for(int j=1;j<=m;++j)
			if(mp[i][j]<=x)addedge(i,j);
	memset(match,0,sizeof(match));
	int ans=0;
	for(int i=1;i<=n;++i)
	{
		memset(vis,0,sizeof(vis));
		ans+=Hungary(i);
	}
	return ans>=K;
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	n=read();m=read();K=n-read()+1;
	for(int i=1;i<=n;++i)
		for(int j=1;j<=m;++j)
			a[++tot]=mp[i][j]=read();
	sort(a+1,a+1+tot);
	int l=K,r=tot;
	while(l<r)
	{
		int mid=(l+r)>>1;
		if(chk(a[mid]))r=mid;
		else l=mid+1;
	}
	printf("%d\n",a[r]);
	return 0;
}
